package com.kitty.game.npc.service.appreace;

import com.kitty.game.activity.service.task.TowerTaskHandler;
import com.kitty.game.config.NPC;
import com.kitty.game.npc.message.RespNpcContent;
import com.kitty.game.rank.model.record.TowerMirrorRankRecord;
import com.kitty.game.role.message.RespAppear;
import com.kitty.game.role.message.RespUpdateAppearance;
import com.kitty.game.role.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
//通天塔
@Component
public class TowerAppearanceHandler extends AppearanceHandler {
    @Autowired
    TowerTaskHandler towerTaskHandler;

    @Override
    public void changeRespAppear(Role role, NPC npc, RespAppear respAppear) {
        TowerMirrorRankRecord xinJunRankData = towerTaskHandler.getXinJunRankData(role, npc.getId());
        if (xinJunRankData != null) {
            respAppear.setTitle(xinJunRankData.getName());
            respAppear.setIcon(xinJunRankData.getIcon());
        }
    }

    @Override
    public void changeRespUpdateAppearance(Role role, NPC npc, RespUpdateAppearance respUpdateAppearance) {
        TowerMirrorRankRecord xinJunRankData = towerTaskHandler.getXinJunRankData(role, npc.getId());
        if (xinJunRankData != null) {
            respUpdateAppearance.setTitle(xinJunRankData.getName());
            respUpdateAppearance.setIcon(xinJunRankData.getIcon());
        }
    }

    @Override
    public void changeRespNpcContent(Role role, NPC npc, RespNpcContent respNpcContent) {
        TowerMirrorRankRecord xinJunRankData = towerTaskHandler.getXinJunRankData(role, npc.getId());
        if (xinJunRankData != null) {
            respNpcContent.setNpcIcon(xinJunRankData.getIcon());
        }
    }
}
